//
//  MarkGenerator.swift
//  OneDay
//
//  Created by cheng xi on 2016/10/5.
//  Copyright © 2016年 xicheng. All rights reserved.
//

import UIKit

class TagIdGenerator {
  
  static var lock:Int = 0
  
  static let sharedInstance = TagIdGenerator()
  
  fileprivate init(){}
  
  fileprivate var prefix:Int = 1000
  
  func generatorTagId()->Int{
    objc_sync_enter(TagIdGenerator.lock)
    prefix = prefix + 1
    let value = prefix
    objc_sync_exit(TagIdGenerator.lock)
    return value
  }
  
}
